.\"   $Id: getptype.3,v 1.1 2002/03/08 13:51:02 fred Exp $
.\" @(#)getptype.2 2.11 91/08/22 ; Labo masi cao-vlsi; Author : Frederic Petrot
.if t \{\
.so man1/alc_contents.mac
.XS \n%
.ti 0.2i
getptype
.XE
.XS4 \n%
.ti 0.2i
getptype
.XE4 \}
.TH GETPTYPE 3 "October 1, 1997" "ASIM/LIP6" "MBK UTILITY FUNCTIONS"
.SH NAME
getptype \- retrieve a \fBptype\fP from a \fBptype_list\fP
.so man1/alc_origin.1
.SH SYNOPSIS
.nf
.if n \{\
.ft B \}
.if t \{\
.ft CR \}
#include "mut.h"
ptype_list \(**getptype(pthead,type)
ptype_list \(**pthead;
long type;
.ft R
.fi
.SH PARAMETERS
.TP 20
\fIpthead\fP
Pointer to a \fBptype\fP list
.TP
\fItype\fP
Flag indicating the pointer owner
.SH DESCRIPTION
\fBgetptype\fP looks for a \fBptype\fP element in the list pointed to by
\fIpthead\fP.
.SH RETURN VALUE
\fBgetptype\fP returns a pointer to the \fBptype\fP that match the \fItype\fP.
Be careful, it is not the \fIptype\->DATA\fP that is returned.
If no \fBptype\fP has the given \fItype\fP, then \fBNULL\fP is returned.
.SH EXAMPLE
.ta 3n 6n 9n 12n 15n 18n 21n
.nf
.if n \{\
.ft B \}
.if t \{\
.ft CR \}
#include "mut.h"
#include "mph.h"
void get_corner(ptfig, name, x2, y2)
phfig_list \(**ptfig;
char \(**name;
int \(**x2, \(**y2;
{
phins_list \(**i = getphins(ptfig, name);
ptype_list \(**p = getptype(i\->USER, (long)PLACEABOX);
	\(**x2 = (num_list \(**)(p\->DATA)\->DATA;
	\(**y2 = (num_list \(**)(p\->DATA)\->NEXT\->DATA;
}	
.ft R
.fi
.SH SEE ALSO
.BR mbk (1),
.BR ptype (3),
.BR addptype (3),
.BR freeptype (3),
.BR delptype (3).


.so man1/alc_bug_report.1

